package service

import (
	"zimuzu_cvn_web_api/config"
	"zimuzu_cvn_web_api/model"
	. "zimuzu_cvn_web_api/pkg/e"
)

//获取 cvn 项目周报
func GetWeeklyList(per, page int) (res []model.WeeklyInfo, err error) {
	//从数据库获取数据
	res, err = model.GetWeeklyListFromDB(config.C.DB.DB, per, page)
	if err != nil {
		Log("err", "查询数据库失败", err.Error())
		return nil, err
	}

	return res, err
}

//获取 cvn 新闻报道
func GetNewsList(per, page int) (res []model.NewsInfo, err error) {
	//从数据库获取数据
	res, err = model.GetNewsListFromDB(config.C.DB.DB, per, page, "")
	if err != nil {
		Log("err", "查询数据库失败", err.Error())
		return nil, err
	}

	return res, err
}
